<?php 
/* SVN FILE: $Id: app_controller.php 13 2009-09-26 21:02:43Z kenreily@gmail.com $ */
/**
 * Short description for file.
 *
 * Long description for file
 *
 * PHP versions 4 and 5
 *
 * Recenseo: Online submission and reviewing for education
 * Copyright 2008-2009, Ken Reily
 *
 * Licensed under The MIT License
 * Redistributions of files must retain the above copyright notice.
 *
 * $Date: 2009-09-26 21:02:43 +0000 (Sat, 26 Sep 2009) $
 * $Revision: 13 $
 * $Author: kenreily@gmail.com $
 * $HeadURL: http://recenseo.googlecode.com/svn/trunk/app/app_controller.php $
 */

class AppController extends Controller
{
  var $components = array('Auth');
  var $uses = array('User');

  function beforeFilter()
  {
    // If the user was externally authenticated, this will attempt to log them
    // in using a default password, which is their username. 
    if (!$this->Session->read('Auth.User.id') && !empty($_SERVER['REMOTE_USER']))
    {
      $data['User']['username'] = $_SERVER['REMOTE_USER'];
      $data['User']['password'] = $this->Auth->password($_SERVER['REMOTE_USER']);

      $this->Auth->login($data);
    }

    // Uncomment this line only if you need to manually edit users
    // in extreme situations!
    // $this->Auth->allow('index','edit');
  }

  function login() 
  {
    $this->pageTitle = 'Login';
    
  }

  function logout()
  {
  }
  
}
?>